package com.carrental.amap.controller;

import com.alibaba.fastjson.JSON;
import com.carrental.amap.service.AmapService;
import com.carrental.common.response.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.spring.web.json.Json;

import java.util.Map;

/**
 * @author admin
 * @since 2022/3/25 11:05
 */
@Api(tags = "高德地图web服务")
@RestController
@RequestMapping("/api/")
public class WeatherController {

    @Autowired
    private AmapService amapService;

    @GetMapping("/weather")
    @ApiOperation("获取ip所在地天气")
    public CommonResult<Map<String,Object>> getWeather(){
        return CommonResult.success((amapService.weather()));
    }
}
